#include <stdio.h>

void swap(int *a, int *b) {
    int t = *a;
    *a = *b;
    *b = t;
}

int main() {
    int a = 10, b = 20;
    printf("before swap a = %d, b = %d\n", a, b);
    int *pb = &b;
    swap(&a, pb);
    printf("after swap a = %d, b = %d\n", a, b);
    return 0;
}